<?php


namespace app\admin\validate;
use think\Validate;

class TradeChild extends Validate
{
    protected $rule = [
        'id'=>'require',
        'name'=> 'require|unique:trade_child',
        'trade_id' => 'require'
    ];
    protected $message = [
        'id'=>'传入的ID为空',
        'name' => '分类名字必须填写',
        'name.unique' => "分类名字不能重复",
        'trade_id'=>'必须选择所属分类'
    ];

    protected $scene = [
        'trade_child_add' => ["name","trade_id"],
    ];
}